const prodConfig = './config-dev.js';
// 可设定为绝对路径，如 /opt/product/config-override.js
const overrideConfig = './config-override.js';
const testConfig = './config-test.js';
const fs = require('fs');

var config = null;
if(process.env.NODE_ENV==='dev'){
	config = require(testConfig);
}else{
	 config = require(prodConfig);
	 try{ 
	 	if (fs.statSync(overrideConfig).isFile()) { 
	 	       config = Object.assign(config, require(overrideConfig));
	 	   }
	 }catch(e){
	 	//TODO handle the exception
	 }
}
module.exports = config;